<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="../includes/importer.jsp"%>
<!doctype html>
<html>

<head>
<ht:head />
<script type="text/javascript">
</script>
</head>
<body>

	<br />
	<div id="search-menu">
		<ul>
			<ht:menu-btn type="search" />
			<ct:display model="store_list" btn="add_btn">
				<ht:menu-btn text="添加活动" url="/activities/add" type="add" />
			</ct:display>
		</ul>
		<br style="clear: left" />
	</div>
	<div class="queryContainer">
		<form name="queryForm" id="queryForm" action="list" method="get">
			<table>
				<tr>
					<td width="100">活动名称：</td>
					<td width="150"><input type="text" name="name" value="${param.name}" class="txt" style="width: 150px" /></td>
					
					<td width="65">创建时间：</td> 	
					<td width="300">
	                    <input type="text" id="inputStartTimeS" name="inputStartTimeS" value="${param.inputStartTimeS}" class="txt Wdate"
	                           readOnly onfocus="WdatePicker({vel:'createTime',realDateFmt:'yyyyMMdd',maxDate:'#F{$dp.$D(\'inputEndTimeS\')||\'2020-10-01\'}'})" />
	                    <input type="hidden" name="createTime" id="createTime" value="${param.createTime}"/>
	                   	 至
	                    <input type="text" id="inputEndTimeS" name="inputEndTimeS" value="${param.inputEndTimeS}" class="txt Wdate"
	                           readOnly onfocus="WdatePicker({vel:'cerateTimeEnd',realDateFmt:'yyyyMMdd',minDate:'#F{$dp.$D(\'inputStartTimeS\')}',maxDate:'2020-10-01'})" />
	                    <input type="hidden" name="cerateEndTime" id="cerateEndTime" value="${param.cerateEndTime}" />
	                </td>
	                
	                <td width="65">活动时间：</td> 	
					<td width="300">
	                    <input type="text" id="inputSaleStartTimeS" name="inputSaleStartTimeS" value="${param.inputSaleStartTimeS}" class="txt Wdate"
	                           readOnly onfocus="WdatePicker({vel:'startTime',realDateFmt:'yyyyMMdd',maxDate:'#F{$dp.$D(\'inputSaleEndTimeS\')||\'2020-10-01\'}'})" />
	                    <input type="hidden" name="startTime" id="startTime" value="${param.startTime}"/>
	                   	 至
	                    <input type="text" id="inputSaleEndTimeS" name="inputSaleEndTimeS" value="${param.inputSaleEndTimeS}" class="txt Wdate"
	                           readOnly onfocus="WdatePicker({vel:'endTime',realDateFmt:'yyyyMMdd',minDate:'#F{$dp.$D(\'inputSaleStartTimeS\')}',maxDate:'2020-10-01'})" />
	                    <input type="hidden" name="endTime" id="endTime" value="${param.endTime}" />
	                   
	                </td>
	                
				</tr>
				<tr>
				<td width="60">活动类型：</td>
					<td width="150">	
					<select name="type">
                   		<option value>--请选择--</option>
	                   	<c:forEach items="${typeMap }" var="typeMap">
	                   		<option value="${typeMap.key }" <c:if test="${param.type==typeMap.key }">selected</c:if>>${typeMap.value }</option>
	                   	</c:forEach>
	                   </select>
	                 </td>
	                <td colspan="4"><ct:btn type="search" /></td>
				</tr>
			</table>
		</form>
	</div>
	<div class="container">
		<br />
		<h3>活动列表</h3>
		<div class="mainbox">
			<c:if test="${not empty pageData}">

				<table class="datalist fixwidth">
					<tr>
						<th nowrap="nowrap" width="120">活动名称</th>
						<th nowrap="nowrap" width="100">活动类型</th>
						<th nowrap="nowrap" width="60">审核状态</th>
						<th nowrap="nowrap" width="60">上线状态</th>
						<th nowrap="nowrap" width="130">创建时间</th>
						<th nowrap="nowrap" width="130">活动开始时间</th>
						<th nowrap="nowrap" width="130">活动结束时间</th>
						<th nowrap="nowrap">操作</th>
					</tr>
				<c:forEach items="${pageData.data}" var="item">
						<tr>
							<td nowrap="nowrap">${item.name}</td>
							<td nowrap="nowrap" class="ellipsis">${typeMap[item.type] }</td>
							<td nowrap="nowrap">${auditStatusMap[item.status]}</td>
							<td nowrap="nowrap">${saleStatusMap[item.isValid]}</td>
							<td nowrap="nowrap"><ct:time source="${item.createTime }"/></td>
							<td nowrap="nowrap"><ct:time source="${item.startTime }"/></td>
							<td nowrap="nowrap"><ct:time source="${item.endTime }"/></td>
							<td nowrap="nowrap">
								<ct:display model="activities_list" btn="view_btn">
									<a href="view/${item.id}">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								</ct:display>
								
								<ct:display model="activities_list" btn="mod_btn">
									<a href="edit?id=${item.id}">修改</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								</ct:display>
								
								<c:if test="${item.status == 0 }">
									<ct:display model="activities_list" btn="send_audit_btn">
										<a href="#" onclick="dealInfo('确认送审？','sendAudit?id=${item.id}');">送审</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									</ct:display>
								</c:if>
								
								<c:if test="${item.status != 0 && item.status != 3 }">
									<ct:display model="activities_list" btn="send_audit_btn">
										<a href="audit?id=${item.id}">审核</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									</ct:display>
								</c:if>
								
								<c:if test="${item.status==3&&item.isValid==0  }">
									<ct:display model="activities_list" btn="up_line_btn">
										<a href="#" onclick="dealInfo('确认上线？','ruing/1/${item.id}');">上线</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									</ct:display>
								</c:if>
								
								<c:if test="${item.status==3&&item.isValid==1  }">
									<ct:display model="activities_list" btn="down_line_btn">
										<a href="#" onclick="dealInfo('确认下线？','ruing/0/${item.id}');">下线</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									</ct:display>
								</c:if>
								
								<ct:display model="activities_list" btn="del_btn">
									<a href="#this" onclick="delete('delete/${item.id}');">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								</ct:display> 
								
							</td>
						</tr>
				</c:forEach>
				</table>

				<ht:page pageData="${pageData}" />

			</c:if>
			<c:if test="${empty pageData.data}">
				<div class="note">
					<p class="i">目前没有相关记录!</p>
				</div>
			</c:if>
		</div>

	</div>

</body>
</html>